var edit_customize_task = function() {
	this.button = $("#edit_customize_button");
	this.container = $("#edit_customize_task");
	this.tit = this.container.find(">.colist_t>ul:eq(0)");
	var ta = this.tit.children(".edit_gz");
	this.openbut = ta.find("a:eq(0)");
	this.nonebut = ta.find("a:eq(1)");
	this.nav = this.tit.find(">.co_b>p:eq(0)");
	this.con = this.container.children(".colist_c");
	this.nav_key = this.nav.children("a").eq(0);
	this.nav_con = this.con.children("dl[name='9999']");
	this.editbox = new edit_customize_box();
	this.setState = 0;		//0没登陆, 1没设置, 2已设置(被显示), 3被隐藏
	this.init();
}

edit_customize_task.prototype = {
	init: function() {
		var me = this;
		$.getJSON("http://u.zhubajie.com/follow/?jsoncallback=?", function(json) {
			if(json.state === 0 || json.state === '0') {
				if(at_userData() == null) {
					me.setState = 0;
				} else {
					me.setState = 1;
				}
			} else if(json.state === 1 || json.state === '1'){
				me.setState = 2;
				me.insertData(json.keyword, json.type);
			} else if(json.state === 2 || json.state === '2'){
				me.setState = 3;
			}
			//setState:
			if(me.setState == 0 || me.setState == 1 || me.setState == 3) {
				me.button.show();
				me.container.hide();
			} else if (me.setState == 2) {
				me.button.hide();
				me.container.show();
			}
			me.bindDefaultEvent();
		});
	},
	bindDefaultEvent: function() {
		var me = this;
		this.button.unbind("click");
		this.openbut.unbind("click");
		this.nonebut.unbind("click");
		this.button.bind("click", function() {
			function logincall() { 
				me.init();
			}
			if(me.setState == 0)
				at_loginNeed(logincall, logincall, false, "登陆后可继续订制关注关键词和任务");
			else if (me.setState == 1)
				me.editcrtEvent();
			else if (me.setState == 3)
				me.showLists();
			return false;
		});
		this.openbut.bind("click", function() {
			if(me.setState != 2) return false;
			me.openEvent();
			return false;
		});
		this.nonebut.bind("click", function() {
			if(me.setState != 2) return false;
			me.noneLists();
			return false;
		});
		//call Event
		this.editbox.onSave = function() {
			me.init()
			return false;
		}
	},
	editcrtEvent: function() {
		this.editbox.open();
	},
	openEvent: function() {
		this.editbox.open();
	},
	insertData: function(keywordArray, typeArray, isInit) {
		this.deleteHistoryData();
		var keyword = (function() {
			var s = '';
			for(var i=0; i<keywordArray.length; i++) {
				s += keywordArray[i].value + ",";
			}
			return s.replace(/,$/,"");
		})();
		var me = this;
		at_loading.show();
		$.getJSON("http://u.zhubajie.com/follow/keycontent?jsoncallback=?", function(json) {
			at_loading.hide();
			if(json.state == 1) {
				me.nav_con.html(json.msg);
			}
		});
		for(var i=0; i<typeArray.length; i++) {
			if(i == 0)this.nav.append("<u>|</u>");
			this.nav.append("<a href=\"http://list.zhubajie.com/"+typeArray[i].cndir+"/\" target=\"_blank\"  cl=\""+typeArray[i].id+"\">"+typeArray[i].cname+"</a>");
			if(i < typeArray.length-1) this.nav.append("<u>|</u>");
		}
		var a = this.nav.find("a");
		window["bindA"](a);
		a.eq(0).mouseover();
	},
	noneLists: function() {
		var me = this;
		at_infoTrace.show("该区域隐藏后，在页面左边点击\"定制我的任务\"图标即可再次打开", "i", null, [
			at_traces_i.getButton("我知道了", "gray", function() {
				at_infoTrace.hide();
				at_loading.show();
				$.getJSON("http://u.zhubajie.com/follow/hide?jsoncallback=?", function(json) {
					at_loading.hide();
					if(json.state === 1 || json.state === '1') {
						me.init();
					} else at_infoTrace.show("设置隐藏失败", "e");
				});
			}),
			at_traces_i.getButton("取消", "gray", "close")
		], true);
	},
	showLists: function() {
		var me = this;
		at_loading.show();
		$.getJSON("http://u.zhubajie.com/follow/show?jsoncallback=?", function(json) {
			at_loading.hide();
			if(json.state === 1 || json.state === '1') {
				me.init();
			} else at_infoTrace.show("设置显示失败", "e");
		});
	},
	deleteHistoryData: function() {
		this.nav.find("a[cl!='9999'],u[class!='first_u']").remove();
	}
}
window.onerror=function(){return true;}
if($.cookie("userid")) {
	var userid = $.cookie("userid");
	var isshopurl = "http://shop.zhubajie.com/api/isshop-uid-"+userid+".html?jsoncallback=?"; 
} else {
	var isshopurl = "http://shop.zhubajie.com/api/isshop-uid-0.html?jsoncallback=?"; 
}
$.getJSON(isshopurl,function (json) {
	if(json.state == 0) {
		var str = "<a href=\"http://u.zhubajie.com/register\" class=\"a_li fl\">免费注册</a>";
            str+= "<a href=\"http://u.zhubajie.com/login\" class=\"a_li fr\">登录</a>";
            str+= "<a href=\"http://task.zhubajie.com/post\" class=\"b_li fl\">发布任务</a>";
            str+= "<a href=\"http://shop.zhubajie.com/signup/index\" class=\"b_li fr\">免费开店</a>";
		document.getElementById("islogin").innerHTML = str;		
	} else {
		var str = "<div class=\"fl login_in clearfix\"><a href=\"http://u.zhubajie.com\">进入我的猪八戒</a><span>|</span><a href=\"http://u.zhubajie.com/order/sell\" class=\"co2\">我的订单管理</a></div>";
            str+= "<a href=\"http://task.zhubajie.com/post\" class=\"b_li fl\">发布任务</a>";
            str+= "<a href=\"http://shop.zhubajie.com/setabout/index\" class=\"b_li fr\" id=\"shopa\">管理店铺</span></a>";
		document.getElementById("islogin").innerHTML = str;		
	}
});
new at_select("at_select");
new at_select("at_selecta");
new at_imgSwitch("at_imgSwitch",true);
new at_imgSwitch("at_imgSwitch2",true,6000);
var at_imgSwitch3=new at_imgSwitch("at_imgSwitch3");
at_imgSwitch3.onSwitch=function(index){
    var imgSwitch=$("#at_imgSwitch3");
    var strong=imgSwitch.parents("dd").find("strong");
    var a=imgSwitch.find("a");
    imgSwitch.prev().html(index +1);
    strong.text(a.eq(index).attr("title"));
}
var at_imgSwitch4=new at_imgSwitch("at_imgSwitch4");
at_imgSwitch4.onSwitch=function(index){
    var imgSwitch=$("#at_imgSwitch4");
    var strong=imgSwitch.parents("dd").find("strong");
    var a=imgSwitch.find("a");
    imgSwitch.prev().html(index +1);
    strong.text(a.eq(index).attr("title"));
}
var at_imgSwitch5=new at_imgSwitch("at_imgSwitch5");
at_imgSwitch5.onSwitch=function(index){
    var imgSwitch=$("#at_imgSwitch5");
    var strong=imgSwitch.parents("dd").find("strong");
    var a=imgSwitch.find("a");
    imgSwitch.prev().html(index +1);
    strong.text(a.eq(index).attr("title"));
}
var at_imgSwitch6=new at_imgSwitch("at_imgSwitch6");
at_imgSwitch6.onSwitch=function(index){
    var imgSwitch=$("#at_imgSwitch6");
    var strong=imgSwitch.parents("dd").find("strong");
    var a=imgSwitch.find("a");
    imgSwitch.prev().html(index +1);
    strong.text(a.eq(index).attr("title"));
}
var at_imgSwitch7=new at_imgSwitch("at_imgSwitch7");
at_imgSwitch7.onSwitch=function(index){
    var imgSwitch=$("#at_imgSwitch7");
    var strong=imgSwitch.parents("dd").find("strong");
    var a=imgSwitch.find("a");
    imgSwitch.prev().html(index +1);
    strong.text(a.eq(index).attr("title"));
}
new at_tab("tabdom");
/*导行滚动，上下，今日，本月*/
(function(){
	var nav_today=$("#nav_today"),
		nav_today_up=$("#nav_today_up"),
		nav_today_down=$("#nav_today_down"),
		ul=nav_today.find("ul");
		ul_h=nav_today.height();
	nav_today.append(ul.clone());
	var n=0;
	var ul_size=ul.size();
	function start()
	{
	    scrollUp();
	    if(n==ul_size)
	    {
		    nav_today.scrollTop(0);
		    n=0;
	    }
	}
	
	var timer=window.setInterval(function(){
		start();
	},2000);
	
	function stop()
	{
	    clearInterval(timer);
	}
	
	function restart()
	{
	    timer=window.setInterval(function(){
		    start();
	    },2000);
	}
	
	//向上卷动一个ul
	function scrollUp(){
	    if(nav_today.is(":animated")){return false;}
		nav_today.animate({scrollTop:nav_today.scrollTop()+ul_h},"normal",function(){
		        n++;
		        if(n==ul_size){
		            nav_today.scrollTop(0);
		            n=0;
		        }
		    }
	    );
	}
	//向下卷动一个ul
	function scrollDown(){
	    if(nav_today.is(":animated")){return false;}
		nav_today.animate({scrollTop:nav_today.scrollTop()-ul_h},"normal",function(){
		        n--;
		        if(n==0){
		            n=ul_size;
		            nav_today.scrollTop(ul_h*ul_size);
		        };
		    }
		);
	}
	nav_today.mouseover(function(){
		stop();
	}).mouseout(function(){
		restart();
	})
	nav_today_up.click(function(){
	    if(n==0){
            n=ul_size;
            nav_today.scrollTop(ul_h*ul_size);
	    }
		scrollDown();
		return false;
	});
	nav_today_down.click(function(){
	    if(n==ul_size)
	    {
	        n=0;
	        nav_today.scrollTop(0);
	    }
		scrollUp();
		return false;
	});
})();

/*left操作链接*/
(function() {
	var edi=$("#edd li.edd_sle");
	var edi_li=$("#edd li");
	edi_li.hover(function(){
		var lis=edi_li.index(this);
		edi_li.eq(lis).addClass("sel_hover");
	},function(){
		edi_li.removeClass("sel_hover");
	});
	edi.hover(function(){
		edi.addClass("edd_sle_hover");
	},function(){
		edi.removeClass("edd_sle_hover");
	});
})();
/*发布任务*/
var indo=$("#indo_s");
indo.val("");
indo.focus(function(){
	indo.addClass("indos2");
	}).blur(function(){
		var inc=indo.val();
		if(inc==""){
			indo.removeClass("indos2");
		}
	}).click(function(){
		indo.addClass("indos2");
	});
/*任务搜索*/
(function(){
	var setx=$(".searchTxt");
	 setx.blur(function(){
		if(setx.val()==''){
			setx.val("请输入搜索的关键词!");
			setx.css({color: "#ccc"})
		}
	}).focus(function(){
		if(setx.val()=='请输入搜索的关键词!'){
			setx.val("");
			setx.css({color: "#000"})
		}
	 }).click(function(){
		if(setx.val()=='请输入搜索的关键词!'){
			setx.val("");
			setx.css({color: "#000"})
		}
	 })
})();
/*导航切换   搜索按钮背景切换  */
(function() {
	var nav_lis=$("#nav_lis a");
	nav_lis.hover(function(){
		var lis=nav_lis.index(this);
		nav_lis.eq(lis).addClass("nav_hover");
	  },function(){
		$(this).removeClass("nav_hover");
	});
	var searbg=$("#searchbg");
	searbg.hover(function(){
		searbg.addClass("searbg");
	  },function(){
		$(this).removeClass("searbg");
	});
})();

/*下拉分类*/
(function() {
	var jy_v=$("#jy_vois");
	var jy_b=$("#jy_vois b");
	var jy_c=$("#jy_list");
	var jy_li=$("#jy_list li");
	var jy_dl=$("#jy_list li dl");
	jy_c.show();
	jy_b.addClass("ja");
	jy_v.hover(function(){
		jy_v.addClass("jy_ti_hover");
		},function(){
		jy_v.removeClass("jy_ti_hover");
	})
	
	jy_li.hover(function(){
		var lis=jy_li.index(this);
		jy_li.eq(lis).addClass("select");
		jy_dl.eq(lis).show();
	  },function(){
		$(this).removeClass("select");
		jy_dl.hide();
	  });
})();

/* 重磅推荐左右滚动 */
var saidyhuio233 = window.setTimeout(function(){
    var let=$("#gunlr li.let"),
        rit=$("#gunlr li.rit"),
        p=$("#gunlr li.con"),
        size=$("#gunlr li.con td").size()/2,
        n=1,
        width=p.find("td").eq(0).outerWidth(true)*2;
    let.click(function(){
        if(n==1 || p.is(":animated")) return false;
        p.animate({scrollLeft:p.scrollLeft()-width},"normal",function(){
            n--;
        });
    }).hover(
        function(){
            $(this).fadeTo("fast",0.5);
        },function(){
            $(this).fadeTo("fast",1);
        }
    );
    rit.click(function(){
        if( n==size || p.is(":animated")){return false;}
        p.animate({scrollLeft:p.scrollLeft()+width},"normal",function(){
            n++;
        });
    }).hover(
        function(){
            $(this).fadeTo("fast",0.5);
        },function(){
            $(this).fadeTo("fast",1);
        }
    );
},500);

(function(){
	
	new edit_customize_task();
	
    var co_a=$("#at-colist li.co_a");
    var co_c=$("#at-colist li.co_c");
    var co_b=$("#at-colist li.co_b");
    if($.browser.mozilla || $.browser.opera  || $.browser.safari || $.browser.chrome)
    {
        co_b.find("p").css("position","relative");
    }
    var a=co_b.find("a");
    var width=50;
    var timer=null;
    var timer2=null;
    var timer3=null;
    var timer4=null;
    var isWaiting=false;//是否处于读取数据的状态中
    //获取数据
    function getData(ptype,cl,fn)
    {
        isWaiting=true;
        $.getJSON("http://u.zhubajie.com/follow/taskcontent?cid="+cl+"&jsoncallback=?",function(json){
            isWaiting=false;
            if(json.state==1)
            {
                fn(json.msg);
            }else{
                fn(false);
            }
        });
    }
    //显示隐藏dl
    function showDL($this,as,dls,cl,colist_c)
    {
        //调整分类名称的位置
        var oleft=$this.get(0).offsetLeft;
        var li=$this.parents("li");
        var sleft=li.scrollLeft();
        var o_w=$this.outerWidth();
        
        if(sleft>oleft)
        {
            li.animate({scrollLeft:oleft-o_w},"fast");
        }else if((oleft+o_w-li.width())>sleft){
            li.animate({scrollLeft:oleft-li.width()+o_w*2},"fast");
        }
        
        hideWaiting(colist_c,true);
        as.removeClass("cousel");
        $this.addClass("cousel");
        dls.removeClass("cousel");
        var cur_dl=dls.filter("[name='"+cl+"']");
        var ptype=$this.parents(".colist_t").find("a.ptype").attr("value");
        if(cur_dl.size()>0){
            cur_dl.addClass("cousel");
        }else{
            //显示等待图标
            showWaiting(colist_c);
            getData(ptype,cl,function(html){
                if(html)
                {
                    hideWaiting(colist_c,true);
                    colist_c.append(html);
                }else{
                    hideWaiting(colist_c,false);
                }
                //当不处于读取状态时，才显示需要显示的dl
                if(!isWaiting){
                    colist_c.find("dl").removeClass("cousel").filter("[name='"+ as.filter(".cousel").attr("cl")+"']").addClass("cousel");
                }
            });
        }
    }
    //显示等待图标
    function showWaiting(colist_c)
    {
        //隐藏可能的错误提示
        colist_c.find("span.at_text").hide();
        var wait=colist_c.find("img.waiting");
        if(wait.size()==0)
        {
            colist_c.append("<img style=\"display: block; position: relative; left: 374px; top: 100px;\" class=\"waiting\" src=\"http://s.zbjimg.com/img/write_max.gif\">");
        }else{
            wait.show();
        }
    }
    //隐藏等待图标
    function hideWaiting(colist_c,nomsg)
    {
        colist_c.find("img.waiting").hide();
        var error=colist_c.find("span.at_text");
        if(!nomsg)
        {
            if(error.size()>0)
            {
                error.show();
            }else{
                colist_c.append("<span class=\"at_text\" style=\"position: relative; left: 315px; top: 100px;\"><em><u class=\"at_msg m_3_e\"></u>对不起，读取不到数据</em></span>");
            }
        }else{
            error.hide();
        }
    }
	function bindA(a,fn)
    {
		a.unbind("mouseover");
        a.mouseover(function(){
            var $this=$(this);
            var cl=$this.attr("cl");
            if(!cl){return false;}
            timer4=window.setTimeout(function(){
                var colist=$this.parents(".colist");
                var colist_c=colist.find("div.colist_c");
                var dls=colist.find("dl");
                var as=$this.parent().find("a");
                showDL($this,as,dls,cl,colist_c);
            },200);
        }).mouseout(function(){
            clearTimeout(timer4);
        });
        if(fn){fn();}
    }
    bindA(a);
    window["bindA"]=bindA;
    
    function co_c_click(obj)
    {
        clearTimeout(timer2);
        var co_b=obj.parent().find("li.co_b");
        if(co_b.is(":animated")){return false;}
        co_b.animate({scrollLeft:co_b.scrollLeft()+width},"fast",function(){
            var colist=co_b.parents(".colist");
            var colist_c=colist.find("div.colist_c");
            var dls=colist_c.find("dl");
            var as=co_b.find("a");
            var as_size=as.size();
            var curi=0;
            as.each(function(index){
                if($(this).hasClass("cousel")){
                    curi=index;
                }
            });
            if(curi==as_size-1){
                return false;
            }else{
                curi++;
            }
            var cl=as.eq(curi).attr("cl");
            if(!cl){return false;}
            showDL(as.eq(curi),as,dls,cl,colist_c);
        });        
    }
    
    co_c.click(function(){
        co_c_click($(this));
    }).mousedown(function(){
        var co_b=$(this).parent().find("li.co_b");
        timer3=setTimeout(function(){
            timer=setInterval(function(){
                co_b.scrollLeft(co_b.scrollLeft()+3);
            },1);
        },50);
        timer2=setTimeout(function(){
            co_c.unbind("click");
        },200);
    }).mouseup(function(){
        var co_b=$(this).parent().find("li.co_b");
        clearTimeout(timer3);
        clearInterval(timer);
        clearTimeout(timer2);
        timer2=setTimeout(function(){
            co_c.click(function(){
                co_c_click($(this));
            });
        },200);
    }).each(function(){$(this).attr("title","试试看按住鼠标左键不放")});
    
    function co_a_click(obj)
    {
        clearTimeout(timer2);
        var co_b=obj.parent().find("li.co_b");
        if(co_b.is(":animated")){return false;}
        co_b.animate({scrollLeft:co_b.scrollLeft()-width},"fast",function(){
            var colist=co_b.parents(".colist");
            var colist_c=colist.find("div.colist_c");
            var dls=colist_c.find("dl");
            var as=co_b.find("a");
            var as_size=as.size();
            var curi=0;
            as.each(function(index){
                if($(this).hasClass("cousel")){
                    curi=index;
                }
            });
            if(curi==0){
                return false;
            }else{
                curi--;
            }
            var cl=as.eq(curi).attr("cl");
            showDL(as.eq(curi),as,dls,cl,colist_c);
        });        
    }
    co_a.click(function(){
        co_a_click($(this));
    }).mousedown(function(){
        var co_b=$(this).parent().find("li.co_b");
        timer3=setTimeout(function(){
            timer=setInterval(function(){
                co_b.scrollLeft(co_b.scrollLeft()-3);
            },1);
        },50);
        timer2=setTimeout(function(){
            co_a.unbind("click");
        },200);
    }).mouseup(function(){
        var co_b=$(this).parent().find("li.co_b");
        clearInterval(timer);
        clearTimeout(timer2);
        clearTimeout(timer3);
        timer2=setTimeout(function(){
            co_a.click(function(){
                co_a_click($(this));
            });
        },200);
    }).each(function(){$(this).attr("title","试试看按住鼠标左键不放")});
    
    var colist_c=$("#at-colist div.colist_c");
    colist_c.css("height","255px");
    /*fix_ff*/
    if($.browser.mozilla)
    {
        colist_c.css("margin-top","1px");
    }
})();

/*新发布和中标信息滚动*/
(function(){
    var dota1=$("#dota1"),
        dota2=$("#dota2"),
        ta_tc1=dota1.find("ul"),
        ta_tc2=dota2.find("ul");
        
    var scroll=function(uls){
        //复制一次内部的li
        var li_h=uls.eq(0).find("li").outerHeight();
        this.copy=function(){
            uls.each(function(){
                var lis=$(this).find("li");
                $(this).append(lis.clone());
                $(this).attr("li_s",lis.size()*2);
                $(this).attr("cur_li",lis.size()*2-1);
            });
        }
        this.copy();
        //移动到最下边的li
        this.toLast=function(){
            uls.each(function(){
                $(this).scrollTop(10000);
            });
        }
        this.toLast();

        var timer=null;//滚动的超时时间
        var i=0;
        //开始滚动ul数组
        function start(i)
        {
            var cur_ul=uls.eq(i);
            if(cur_ul){
                cur_ul.animate({scrollTop:cur_ul.scrollTop()-li_h},function(){
                    var cur_li=parseInt(cur_ul.attr("cur_li"));
                    var li_s=parseInt(cur_ul.attr("li_s"));
                    cur_li--;
                    if((li_s/2-1)==cur_li)
                    {
                        cur_ul.attr("cur_li",li_s-1);
                        $(this).scrollTop(10000);
                    }else{
                        cur_ul.attr("cur_li",cur_li);
                    }
                    start(++i);
                });
            };
        }
        timer=setInterval(function(){ start(i);},7000);
    }
    scroll(ta_tc1);
    scroll(ta_tc2);
})();

//倒计时
(function() {
	//传入时分秒容器
	var secondsShow = function(h, m, s) {
		this.h_n = null; 
		this.m_n = null;
		this.s_n = null;
		this.irv = null;
		var _this = this;
		//init
		this.init = function() {
			this.h_n = parseInt(h.text()); 
			this.m_n = parseInt(m.text());
			this.s_n = parseInt(s.text());
		}
		this.init();
		//interval
		this.irv = window.setInterval(function() {
			if(_this.s_n-1 >= 0) {
				s.text(_this.s_n-1);
			} else {
				s.text(59);
				if(_this.m_n-1 >= 0) {
					m.text(_this.m_n-1);
				} else {
					m.text(59);
					if(_this.h_n-1 >= 0) {
						h.text(_this.h_n-1);
					} else {
						window.clearInterval(_this.irv);
						h.parent().html("已结束");
					}
				}
			}
			_this.init();
		},1000);
	}
	//init
	var con = $("#at-colist"),
		time = con.find("i.d_time"),
		item = null;
	for(var i=0; i<time.length; i++) {
		item = time.eq(i).children("u");
		new secondsShow(item.eq(0), item.eq(1), item.eq(2));
	}
})();

/*
    用处：未处理订单提醒，多个页面用到
    1、结构
    <div class="my_order">
    	<p class="til_order">我的订单:</p>
        <div class="see_order" id="see_order">
        </div>
    </div>
    2、在每个需要提醒的页面调用seeOrder()
*/
function seeOrder()
{
    var seeoc=$("#see_order"); 
    //订单列表
    function showList()
    {
	    var seeoc_c=$("#see_order div.tcd");
	    seeoc.hover(function(){
		    seeoc_c.show();
		    seeoc.addClass("see_order_to");
	    },function () {
		    seeoc_c.hide();
		    seeoc.removeClass("see_order_to");
	    });
    }
    //不存在订单提示区，退出
    if(seeoc.size()==0)
    {
        return false;
    }else{
        var loged=false;
        //判断是否登录
        var userid=$.cookie("userid");
        if(userid && parseInt(userid)>0){
            loged=true;
        }

        //如果未登录，则从cookie中读取购物车
        if(!loged)
        {
            var cv=$.cookie("zbcart_ck");
            try{
                if(cv=="" || !cv){
                    cv=0;
                }else{
                    cv=cv.split(",").length;
                }
            }catch(e){
                cv=0;
            }
            //如果订单数为0
            if(!cv || cv==0)
            {
                seeoc.append("<p class=\"ts\">有<u>0</u>个订单需要处理</p>");
                seeoc.append("<div class=\"tcd\">您暂无需要处理的订单</div>");
                showList();
            }else{
                //否则，读取订单列表
                seeoc.append("<p class=\"ts\">有<u>"+cv+"</u>个订单需要处理</p>");
                $.getJSON("http://search.zhubajie.com/cart-loadcart?jsoncallback=?",{},function(json){
                    if(json.state==1)
                    {
                        seeoc.append("<div class=\"tcd\"><ul>"+json.html+"</ul><p><a href=\"http://u.zhubajie.com/order/buy?os=1&ps=0\" class=\"at_but b_pic\"><u></u>进入订单管理</a> <a href=\"http://search.zhubajie.com/cart-cartlist\" class=\"at_but b_pic\"><u></u>进入购物车</a></p></div>");
	                    showList();
                    }
                });
            }
        }else{
            $.getJSON("http://search.zhubajie.com/cart-loadcart?jsoncallback=?",{},function(json){
                if(json.state==1)
                {
                    seeoc.append("<p class=\"ts\">有<u>"+json.count+"</u>个订单需要处理</p>");
                    seeoc.append("<div class=\"tcd\"><ul>"+json.html+"</ul><p><a href=\"http://u.zhubajie.com/order/buy?os=1&ps=0\" class=\"at_but b_pic\"><u></u>进入订单管理</a> <a href=\"http://search.zhubajie.com/cart-cartlist\" class=\"at_but b_pic\"><u></u>进入购物车</a></p></div>");
                    showList();
                }else{
                    seeoc.append("<p class=\"ts\">有<u>0</u>个订单需要处理</p>");
                    seeoc.append("<div class=\"tcd\">您暂无需要处理的订单</div>");
                    showList();
                }
            });
        }
    }
};
seeOrder();
